#!/bin/bash

sigint()
{
    echo -e "\033[0m"
    exit
}

trap sigint INT
cnt=0

while true; do
    touch .timestamp
    echo -en "\033[$((cnt++ % 2 ? 31 : 32))m"
    echo "watching"
    inotifywait -q -r src -e modify
    echo "compiling"
    find src -name "*.uml" , -newer .timestamp | xargs plantuml
    echo "compiled"
done
